@if ($user->role > 0 || $user->hasRole('Founder'))
<div class="side-nav expand-lg">
  <div class="side-nav-inner">
    <ul class="side-nav-menu">
      <li class="side-nav-header">
        <span>转发系统会员中心</span>
      </li>
      @if( $user->can('edit_settings'))
      <li class="nav-item dropdown {{ active_class(if_route('settings.edit'), 'open')}}">
        <a href="{{ route('settings.edit') }}">
          <span class="icon-holder">
            <i class="lni-bulb"></i>
          </span>
          <span class="title">系统配置</span>
        </a>
      </li>
      @endif
      @if (! $user->hasRole('Founder'))
      <li class="nav-item dropdown {{ active_class( if_route('notices.index'), 'open') }}">
        <a href="{{ route('notices.index') }}">
          <span class="icon-holder">
            <i class="lni-bulb"></i>
          </span>
          <span class="title">通知</span>
        </a>
      </li>
      @else
      <li class="nav-item dropdown {{ active_class( (if_route('notices.create') || if_route('notices.index') || if_route('notices.show') || if_route('feed_backs.index') ), 'open') }}">
        <a class="dropdown-toggle" href="#">
          <span class="icon-holder">
            <i class="lni-cloud"></i>
          </span>
          <span class="title">通知管理</span>
          <span class="arrow">
            <i class="lni-chevron-right"></i>
          </span>
        </a>
        <ul class="dropdown-menu sub-down">
          <li class="{{ active_class(if_route('notices.create')) }}">
            <a href="{{ route('notices.create') }}">添加通知</a>
          </li>
          <li class="{{ active_class(if_route('notices.index') || if_route('notices.show')) }}">
            <a href="{{ route('notices.index') }}">通知列表</a>
          </li>
          <li class="{{ active_class(if_route('feed_backs.index') || if_route('feed_backs.show')) }}">
            <a href="{{ route('feed_backs.index') }}">用户反馈</a>
          </li>
        </ul>
      </li>
      <li class="nav-item dropdown {{ active_class( (if_route('domains.create') || if_route('domains.index') || if_route('domains.show')), 'open') }}">
        <a class="dropdown-toggle" href="#">
          <span class="icon-holder">
            <i class="lni-cloud"></i>
          </span>
          <span class="title">域名池</span>
          <span class="arrow">
            <i class="lni-chevron-right"></i>
          </span>
        </a>
        <ul class="dropdown-menu sub-down">
          <li class="{{ active_class(if_route('domains.create')) }}">
            <a href="{{ route('domains.create') }}">添加域名</a>
          </li>
          <li class="{{ active_class(if_route('domains.index') || if_route('domains.show')) }}">
            <a href="{{ route('domains.index') }}">域名列表</a>
          </li>
        </ul>
      </li>
      @endif
      <li class="nav-item dropdown {{ active_class( (if_route('sites.create') || if_route('sites.index') || if_route('sites.show') || if_route('sites.edit') || if_route('sites.member') || if_route('short_urls.show')), 'open') }}">
        <a class="dropdown-toggle" href="#">
          <span class="icon-holder">
            <i class="lni-cloud"></i>
          </span>
          <span class="title">站点管理</span>
          <span class="arrow">
            <i class="lni-chevron-right"></i>
          </span>
        </a>
        <ul class="dropdown-menu sub-down">
          <li class="{{ active_class(if_route('sites.create')) }}">
            <a href="{{ route('sites.create') }}">添加站点</a>
          </li>
          <li class="{{ active_class(if_route('sites.index') || if_route('sites.show') || if_route('sites.edit') || if_route('sites.member')) }}">
            <a href="{{ route('sites.index') }}">站点列表</a>
          </li>
        </ul>
      </li>
      @if ($user->hasRole('Founder'))
      <li class="nav-item dropdown {{ active_class(if_route('members.index') || if_route('members.show') || if_route('members.edit') || if_route('members.create'), 'open') }}">
        <a class="dropdown-toggle" href="#">
          <span class="icon-holder">
            <i class="lni-layers"></i>
          </span>
          <span class="title">用户管理</span>
          <span class="arrow">
            <i class="lni-chevron-right"></i>
          </span>
        </a>
        <ul class="dropdown-menu sub-down">
          <li class="{{ active_class(if_route('members.index')) }}">
            <a href="{{ route('members.index') }}">用户列表</a>
          </li>
          <li class="{{ active_class(if_route('members.create')) }}">
            <a href="{{ route('members.create') }}">添加用户</a>
          </li>
          <li class="{{ active_class(if_route('members.index')) }}">
            <a href="{{ route('members.login_logs') }}">登录日志</a>
          </li>
        </ul>
      </li>
      @elseif($user->hasRole('Daili'))
      <li class="nav-item dropdown {{ active_class(if_route('members.index') || if_route('members.show') || if_route('members.edit') || if_route('members.create'), 'open') }}">
        <a class="dropdown-toggle" href="#">
          <span class="icon-holder">
            <i class="lni-layers"></i>
          </span>
          <span class="title">下级管理</span>
          <span class="arrow">
            <i class="lni-chevron-right"></i>
          </span>
        </a>
        <ul class="dropdown-menu sub-down">
          <li class="{{ active_class(if_route('members.index')) }}">
            <a href="{{ route('members.index') }}">下级列表</a>
          </li>
          <li class="{{ active_class(if_route('members.create')) }}">
            <a href="{{ route('members.create') }}">添加下级</a>
          </li>
        </ul>
      </li>
      @endif
      @if($user->hasRole('Founder'))
      <li class="nav-item dropdown {{ active_class(if_route('videos.index') || if_route('videos.create') || if_route('videos.edit'), 'open') }}">
        <a href="{{ route('videos.index') }}">
          <span class="icon-holder">
            <i class="lni-timer"></i>
          </span>
          <span class="title">视频管理</span>
        </a>
      </li>
      @endif
      <li class="nav-item dropdown {{ active_class(if_route('view_counts.index') || if_route('view_counts.show') || if_route('view_counts.sum'), 'open') }}">
        <a class="dropdown-toggle" href="#">
          <span class="icon-holder">
            <i class="lni-package"></i>
          </span>
          <span class="title">数据管理</span>
          <span class="arrow">
            <i class="lni-chevron-right"></i>
          </span>
        </a>
        <ul class="dropdown-menu sub-down">
          <li class="{{ active_class(if_route('view_counts.index') && if_query('date', date('Y-m-d'))) }}">
            <a href="{{ route('view_counts.index') }}?date={{date('Y-m-d')}}">今日数据</a>
          </li>
          <li class="{{ active_class(if_route('view_counts.index') && !if_query('date', date('Y-m-d'))) }}">
            <a href="{{ route('view_counts.index') }}">历史数据</a>
          </li>
          @if ($user->hasRole('Founder'))
          <li class="{{ active_class(if_route('view_counts.sum')) }}">
            <a href="{{ route('view_counts.sum') }}">数据清理</a>
          </li>
          @endif
        </ul>
      </li>
    </ul>
  </div>
</div>
@endif
